#ifndef SHELF_GENERATOR_H
#define SHELF_GENERATOR_H

#include <vector>
#include <assert.h>
#include <string>

#define REGIONS 4
#define NUMBERS 12


class ShelfGenerator
{
public:
  /**
   * @brief ShelfGenerator Default constructor.
   */
  ShelfGenerator();

  /**
   * @brief ShelfGenerator Constructor with config file. Config file format:
   * Name @e Shelf(A, B, C or D) @e Region(1,2,3,4 or 1-4) @e Count
   * @param conf_file
   */
  ShelfGenerator(std::string config_file);

  bool generate();

  std::string operator() (std::string region, int number) const
  {
    assert(region.length () == 1);
    int region_idx = region[0] - 'A';
    int number_idx = number - 1;
    assert(items_.size () > 0 &&
           region_idx >= 0 && region_idx < (int)items_.size () &&
           number_idx >= 0 &&number_idx < (int)items_[0].size());
    return items_[region_idx][number_idx];
  }

private:
  std::vector<std::vector<std::string> > items_;

  std::string config_file_;
};

#endif // SHELF_GENERATOR_H
